package com.ymttest.business.service;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.http.client.ClientProtocolException;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.ymatou.iapi.userservice.parameter.req.CreateUserReq;
import com.ymatou.mq.admin.parameter.MessageListBean;
import com.ymatou.mq.admin.service.MessageListCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymttest.utils.YMTDateUtil;

import net.sf.json.JSONObject;

public class MqQueryCallService {
	public static MessageListBean initMessageListBean(String appid,String code,String bizid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId(appid);
		//userid_code
		MessageListBean.setBizId(bizid);
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode(code);
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	
	
	/**
	 * 商品分佣设置
	 * @param sellerid
	 * @return
	 */
	public static MessageListBean initEditProductRebate(String ProductId){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("sqproduct");
		//userid_code
		MessageListBean.setBizId("0_"+ProductId);
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("mongosync_agentproduct");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	
	/**
	 * 分销员注册
	 * @param sellerid
	 * @return
	 */
	public static MessageListBean initDistributorRegister(Integer userId){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("goduser");
		//userid_code
		MessageListBean.setBizId(userId.toString());
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("update_dsid");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 神器会员系统发送绑定手机号事件
	 * @param sellerid
	 * @return
	 */
	public static MessageListBean initGoduserBindMobile(Integer userId){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("goduser");
		//userid_code
		MessageListBean.setBizId(userId.toString());
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("bind_mobile");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 关闭快递发货-自提-2020421
	 * @param sellerid
	 * @return
	 */
	public static MessageListBean initCloseExpressDelivery(Integer sellerid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("godfreight");
		//userid_code
		MessageListBean.setBizId(sellerid.toString());
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("close_express_delivery");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/** 更改加价配置
	 * @param productid 原商品id
	 * @param mchid 渠道商家id
	 * @return
	 */
	public static MessageListBean initSetMarkupConfig(Integer agentUserId,Integer rootUserId){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("godmchmanage");
		//userid_code
		if(agentUserId!=null&&rootUserId!=null){
			MessageListBean.setBizId("SetMarkupConfig"+"-"+agentUserId+"-"+rootUserId);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("set_markupconfig");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	
	
	/** 删除商品
	 * @param productid 商品id
	 * @return
	 */
	public static MessageListBean initRemoveAgentProduct(String productid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("product");
		//userid_code
		if(productid.length()>0){
			MessageListBean.setBizId(productid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("remove_agentproduct");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	
	/**商品导入
	 * @param productid 原商品id
	 * @param mchid 渠道商家id
	 * @return
	 */
	public static MessageListBean initImportAgentproduct(String productid,Integer mchid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("product");
		//userid_code
		if(productid!=null&&productid.length()>0){
			MessageListBean.setBizId(productid+"_"+mchid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("auto_import_agentproduct");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	
	/**
	 * 查询同步商品自动加价
	 * @param productid 代理商品id
	 * @param mchid 代理商家id
	 * @return
	 */
	public static MessageListBean initSyncAutoMarkup(String productid,Integer mchid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("product");
		//userid_code
		if(productid!=null&&productid.length()>0){
			MessageListBean.setBizId(productid+"_"+mchid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("sync_auto_markup");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	
	/**
	 * 神器商品同步
	 * @param productid
	 * @return
	 */
	public static MessageListBean initoffsale_or_delete(String productid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("product");
		//userid_code
		if(productid!=null&&productid.length()>0){
			MessageListBean.setBizId(productid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("offsale_or_delete");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	
	
	/**
	 * 神器商品同步
	 * @param productid
	 * @return
	 */
	public static MessageListBean initAgentMongoCrud(String productid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("sqproduct");
		//userid_code
		if(productid!=null&&productid.length()>0){
			MessageListBean.setBizId("0_"+productid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("mongosync_agentproduct");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * fql支付回调后发送通知同步分期乐 用户信息 - 授权金额
	 * @param uid
	 * @return
	 */
	public static MessageListBean initPayFQLSyncInfo(String uid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("payment");
		//userid_code
		MessageListBean.setBizId(uid);
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(1));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-1));
		MessageListBean.setQueueCode("fql_sync_memberinfo");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 查询优选商家 创建自建砍价团信息
	 * @param pid
	 * @param qcode CreateGroupon	创建拼团	Y	Y<br>
		ModifyGrouponPrice	更改拼团价	Y	Y<br>
		StopGroupon	停止拼团	Y	Y<br>
	 * @return
	 */
	public static MessageListBean initGroupon(String pid,String qcode){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("product");
		//userid_code
		MessageListBean.setBizId(pid);
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(1));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-1));
		MessageListBean.setQueueCode(qcode);
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**用户服务发送金币消息
	 * @param userid
	 * @param optype  SetLoginId(1, "SetLoginId"), SetLogo(2, "SetLogo"), BindWx(3, "BindWx"),
	 * @return
	 */
	public static MessageListBean initCoinNewtask(Integer userid,String optype){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("userservice");
		//userid_code
		MessageListBean.setBizId(userid+"_"+optype);
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(1));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-1));
		MessageListBean.setQueueCode("coin_newtask");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 查询支付单总线消息
	 * @param tradingid
	 * @return
	 */
	public static MessageListBean initTradingOrderPay(String tradingid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("trading");
		//userid_code
		if(tradingid!=null&&tradingid.length()>0){
			MessageListBean.setBizId("trading_orderpay_"+tradingid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("trading_orderpay");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**商品mongo同步
	 * @param productid
	 * @return
	 */
	public static MessageListBean initPMongoCrud(String productid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("sqproduct");
		//userid_code
		if(productid!=null&&productid.length()>0){
			MessageListBean.setBizId(productid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("mongoservice_crud");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	//activity_status_change
	/**
	 * ReturnProductActivityStock 提前结束活动，会通知JOB删除结束任务，同时发送一条MQ消息
	 * @param productid
	 * @return
	 */
	public static MessageListBean initActivityStatusChange(String productid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("productstock");
		//userid_code
		if(productid!=null&&productid.length()>0){
			MessageListBean.setBizId(productid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("activity_status_change");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 查询spu同步
	 * @param tradingid
	 * @return
	 */
	public static MessageListBean initPspSpuSync(String productId){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("product");
		//userid_code
		if(productId!=null&&productId.length()>0){
			MessageListBean.setBizId(productId);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("syncpspspu");
		MessageListBean.setSize(10);
		return MessageListBean;
	}

	/**
	 * 查询互动直播逆流和推流同步
	 * @param tradingid
	 * @return
	 */
	public static MessageListBean initSteamSync(Integer liveId){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("livevideo");
		//userid_code
		if(liveId!=null){
			MessageListBean.setBizId(liveId.toString());
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("status_change");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 查询小程序支付回调mq通知消息
	 * @param paymentid
	 * @return
	 */
	public static MessageListBean initMiniAppPaynotify(String paymentid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("payment");
		//userid_code
		if(paymentid!=null&&paymentid.length()>0){
			MessageListBean.setBizId(paymentid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-10));
		MessageListBean.setQueueCode("wx_miniapp_paynotify");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	public static MessageListBean initFqlSyncMemberinfo(String paymentid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("payment");
		//userid_code
		if(paymentid!=null&&paymentid.length()>0){
			MessageListBean.setBizId(paymentid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-10));
		MessageListBean.setQueueCode("fql_sync_memberinfo");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 对账通知 发送给交易
	 * @param paymentid
	 * @return
	 */
	public static MessageListBean initCheckPaymentDetail(String paymentid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("payment");
		//userid_code
		if(paymentid!=null&&paymentid.length()>0){
			MessageListBean.setBizId(paymentid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-10));
		MessageListBean.setQueueCode("settle_notify");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 神器对账通知
	 * @param paymentid
	 * @return
	 */
	public static MessageListBean initGodCheckPaymentDetail(String paymentid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("god_payment");
		//userid_code
		if(paymentid!=null&&paymentid.length()>0){
			MessageListBean.setBizId(paymentid);
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-10));
		MessageListBean.setQueueCode("settle_notify");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 用户注销账户
	 * @param uid
	 * @return
	 */
	public static MessageListBean initCloseAccount(Integer uid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("userservice");
		//userid_code
		if(uid!=null&&uid>0){
			MessageListBean.setBizId(uid.toString());
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("mark_old_customer");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	
	/**
	 * 创建微信第三方信息发送总线消息
	 * 包括api/user/createThirdPartyUser和api/user/bindThirdPartyUser
	 * @param uid
	 * @return
	 */
	public static MessageListBean initCreateWx(Integer uid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("userservice");
		//userid_code
		if(uid!=null&&uid>0){
			MessageListBean.setBizId(uid.toString());
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("create_thirdparty_wx");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 经验值变更
	 * @param uid
	 * @return
	 */
	public static MessageListBean initExpLevelChange(String uid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("userservice");
		//userid_code
		if(uid!=null&&uid.length()>0){
			MessageListBean.setBizId(uid+"-"+YMTDateUtil.getSysTime("yyyyMMdd"));
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("expchange");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	
	/**
	 * 创建用户回调事件
	 * @param uid
	 * @return
	 */
	public static MessageListBean initCreateUser(Integer uid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("userservice");
		//userid_code
		if(uid!=null&&uid>0){
			MessageListBean.setBizId(uid.toString());
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("register");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 删除god用户回调事件
	 * @param uid
	 * @return
	 */
	public static MessageListBean initDeleteGodUser(Integer uid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("goduser");
		//userid_code
		if(uid!=null&&uid>0){
			MessageListBean.setBizId(uid.toString());
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("delete_user");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 用户锁定
	 * @param uid
	 * @return
	 */
	public static MessageListBean initUserLock(Integer uid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("userservice");
		//userid_code
		if(uid!=null&&uid>0){
			MessageListBean.setBizId(uid.toString());
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("lock_user");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 查询订单风控回调信息
	 * @param orderid
	 * @return
	 */
	public static MessageListBean riskMessage(String orderid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("tradesafe");
		//userid_code
		if(orderid!=null&&orderid.length()>0){
			MessageListBean.setBizId(orderid.toString());
		}
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("riskControlStatus");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	/**
	 * 获取总线消息body list
	 * 
	 * @param MessageListBean
	 * @return
	 * @throws ClientProtocolException
	 * @throws IOException
	 */
	public static List <Map> GetMqMessage(MessageListBean MessageListBean) throws ClientProtocolException, IOException{
		List <Map> mqmsgs=new ArrayList<Map>();
		MessageListCall MessageListCall=new MessageListCall();
		MessageListCall.setData(false,MessageListBean);
		MessageListCall.callService();
		JsonArray joa=new JsonArray();
		try{
			joa=MessageListCall.getJsonObject().get("content").getAsJsonObject().get("content").getAsJsonArray();
			joa.forEach(ele->{
				String body=StringEscapeUtils.unescapeJava(ele.getAsJsonObject().get("body").toString());
				body=body.substring(1,body.length()-1);
				Logger.debug("body:"+body);
				mqmsgs.add(JSONObject.fromObject(body));
			});
		}catch (Exception e) {
			e.printStackTrace();
			Logger.debug("mq not found:"+FormatUtil.beanToGSONString(MessageListBean));
		}
		return mqmsgs;
	}
	/**
	 * godmchmanage 站点神器消息查询<br/>
	 *  "cs_add"; create_cs-500007201-500007202 mid-cid<br/>
 	"cs_remove"; remove_cs-500007201-500007202	mid-cid<br/>
 	"agent_remove"; remove_agent-500007229-500007230  mid-aid<br/>
	"agent_changetype"; change_agent_type-500007160-3346	mid-atype<br/>
 	"change_avatar"; change_avatar-500007252	mid<br/>
 	"set_markupconfig"; SetMarkupConfig-500000019-500000018	agentId-supplierId<br/>
	 * @param bizid
	 * @param qcode
	 * @return
	 */
	public static MessageListBean initGodmchManage(String bizid,String qcode){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("godmchmanage");
		//userid_code
		MessageListBean.setBizId(bizid);
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode(qcode);
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	public static MessageListBean initGodUpdateWxUserInfo(Integer userid){
		MessageListBean MessageListBean=new MessageListBean();
		MessageListBean.set_search(true);
		MessageListBean.setAppId("goduser");
		//userid_code
		MessageListBean.setBizId(userid.toString());
		MessageListBean.setEndTime(YMTDateUtil.getBeforeOrNextMunite(10));
		MessageListBean.setStartTime(YMTDateUtil.getBeforeOrNextMunite(-60*8));
		MessageListBean.setQueueCode("update_wxinfo");
		MessageListBean.setSize(10);
		return MessageListBean;
	}
	public static void main(String args[]) throws ClientProtocolException, IOException, InterruptedException {
//		p3713663 _ 500772471
		MessageListBean MessageListBean = MqQueryCallService.initImportAgentproduct("p3713663",500772471);
		List <Map> joa = MqQueryCallService.GetMqMessage(MessageListBean);
		if(joa.size()==0){
			Thread.sleep(5000);
			 joa = MqQueryCallService.GetMqMessage(MessageListBean);
		}
		joa.forEach(ele->{
			Logger.debug(ele.toString());
		});
		
		//SetMarkupConfig-500000019-500000018
		 MessageListBean = MqQueryCallService.initGodmchManage("SetMarkupConfig-500000019-500000018","set_markupconfig");
		 joa = MqQueryCallService.GetMqMessage(MessageListBean);
		if(joa.size()==0){
			Thread.sleep(5000);
			 joa = MqQueryCallService.GetMqMessage(MessageListBean);
		}
		joa.forEach(ele->{
			Logger.debug(ele.toString());
		});
	}
}
